home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / VISUALBA / DFVB10.ZIP / PBC-SUBS.DOC < prev    next >
Text File  |  1993-01-06  |  37KB  |  1,107 lines

  1.  
  2.  The following routines are available for your use. DoorFrame itself does not
  3. use most of the routines so you may retain or delete them from DFRAMEX.LIB as
  4. you see fit (the ones DoorFrame uses are noted - DON'T DELETE THEM!). The
  5. library is modularized so if you don't CALL a routine in your code, it will
  6. not be included in the final .EXE file. Since these routines come from the
  7. PBClone library by Tom Hanlin, I have taken the liberty of including his
  8. descriptions of the routines.
  9.  
  10. Name  : BigPrint             (Called by DoorFrame - DON'T DELETE!)
  11. Class : Display
  12. Level : BIOS
  13.  
  14. As the name suggests, this routine displays text in large
  15. characters.  How large?  Eight times as high and as wide as
  16. normal!  Each "big character" will be composed of many
  17. normal-sized characters.  You may choose the normal character
  18. used to create the big characters (the default is a CHR$(219)
  19. solid block character, if you pass a null string here).
  20.  
  21. You should avoid using CHR$(128) to CHR$(255) when in either of
  22. the CGA graphics modes, as many CGAs are unable to display
  23. these characters when in graphics mode.
  24.  
  25.    BigPrint St$, FormCh$, Row%, Column%, Attr%
  26.  
  27. St$       string to display in big characters
  28. FormCh$   character used to compose the big characters
  29. Row%      starting row
  30. Column%   starting column
  31. Attr%     color/attribute of big characters (see CalcAttr)
  32.           NOTE: This is a local only procedure. It will NOT be sent to the
  33.                 remote computer!
  34.  
  35.  
  36. Name  : CalcAttr                (Called by DoorFrame - DON'T DELETE!)
  37. Class : Display
  38. Level : Any
  39.  
  40. An attribute is a combination of the foreground and background colors in a 
  41. format which is used by all types of displays when in text mode. 
  42.  
  43. Foreground colors are usually specified as 0-15, with backgrounds as 0-7.
  44.  
  45.    CalcAttr Foreground%, Background%, Attr%
  46.  
  47. Foreground%  foreground color
  48. Background%  background color
  49. -------
  50. Attr%        color "attribute"
  51.  
  52.  
  53. Name  : CalcDate             (Calculate Date)
  54. Class : Time
  55. Level : Any
  56.  
  57. This routine calculates what the date will be a given number of
  58. days from now, either in the past or the future.  Actually, you
  59. may use any starting date, not just the current date.  An error
  60. code is returned if the starting date or resulting date are not
  61. valid.  Dates may not preceed January 1, 1900.
  62.  
  63. CalcDate accepts the date in any standard form ("01/30/91" or
  64. "01-30-1991", for example) and returns its results in the same
  65. format.
  66.  
  67.    CalcDate StartDate$, Days&, Direction%, NewDate$, ErrCode%
  68.  
  69. StartDate$   starting date
  70. Days&        number of days from the current date (0 or more)
  71. Direction%   return future result (0) or past (nonzero)
  72. -------
  73. NewDate$     resulting date
  74. ErrCode%     whether the dates are valid (0 yes)
  75.  
  76.  
  77. Name  : CDROM
  78. Class : Disk / Equipment
  79. Level : DOS
  80.  
  81. This routine tells you whether the Microsoft CD-ROM Extensions are installed.
  82. If so, it tells you what the letter of the first CD-ROM logical drive is and
  83. how many logical drives exist.
  84.  
  85. Note: The CD-ROM installation check conflicts with the GRAPHICS.COM
  86. installation check for DOS 4.0, due to some screw-up at IBM or Microsoft.
  87. This may cause unexpected results.  I'm not yet sure whether DOS 5.0 is
  88. similarly afflicted.
  89.  
  90.    FirstDrive$ = "x"
  91.    CDROM FirstDrive$, Drives%
  92.  
  93. -------
  94. FirstDrive$   letter of the first logical drive (init to at least one space!)
  95. Drives%       number of logical drives available (0 if no CD-ROM is there)
  96.  
  97.  
  98. Name  : CheckDate            (Check Date validity)
  99. Class : Time
  100. Level : Any
  101.  
  102. This routine checks a date to see if it is valid.
  103.  
  104.    CheckDate MonthNr%, DayNr%, YearNr%, ErrCode%
  105.  
  106. MonthNr%     month number (1-12)
  107. DayNr%       day number (1-31)
  108. YearNr%      year number (1900 on; years <100 assumed 1900s)
  109. -------
  110. ErrCode%     whether the date is valid (0 yes)
  111.  
  112.  
  113. Name  : CheckShare           (Check for SHARE)
  114. Class : Disk
  115. Level : DOS
  116.  
  117. The CheckShare routine determines whether SHARE.EXE is active.
  118. This is particularly helpful before using the BASIC OPEN
  119. statement, which will fail if you request file sharing when
  120. it's not available.  The PBClone file routines handle such
  121. situations automatically, so CheckShare is not needed for them.
  122.  
  123.    CheckShare ShareActive%
  124.  
  125. -------
  126. ShareActive%   whether SHARE is active (0 if no)
  127.  
  128.  
  129. Name  : CheckShare2%         (Check for SHARE)
  130. Class : Disk
  131. Level : DOS
  132.  
  133. The CheckShare2% function determines whether SHARE.EXE is active.  This is
  134. particularly helpful before using the BASIC OPEN statement, which will fail
  135. if you request file sharing when it's not available.  The PBClone file
  136. routines handle such situations automatically, so CheckShare2% is not needed
  137. for them.
  138.  
  139.    ShareActive% = CheckShare2%
  140.  
  141. -------
  142. ShareActive%   whether SHARE is active (0 if no)
  143.  
  144.  
  145. Name  : DateA2R              (Date Actual to Relative)
  146. Class : Time
  147. Level : Any
  148.  
  149. This routine converts an actual date to a relative date,
  150. expressed as a number of days.  This allows you to compare
  151. dates, find out what the date will be in a given number of days
  152. (or what it was a given number of days ago), see how many days
  153. passed between two dates, and so forth.
  154.  
  155. I've frequently seen routines of this nature called "Julian
  156. date" routines. I'm not sure where that nomenclature
  157. originated, as it has nothing to do with the Julian calendar.
  158. Most of these routines rely on approximations through floating
  159. point math, and may or may not handle leap years and centuries
  160. appropriately.  The DateA2R routine takes no such shortcuts and
  161. may be relied upon to return accurate results.
  162.  
  163.    DateA2R MonthNr%, DayNr%, YearNr%, RelDate&
  164.  
  165. MonthNr%     month number (1-12)
  166. DayNr%       day number (1-31)
  167. YearNr%      year number (1900 on; years <100 assumed in 1900s)
  168. -------
  169. RelDate&     relative date
  170.  
  171.  
  172. Name  : DateN2S              (Date Numbers to String)
  173. Class : Time
  174. Level : Any / DOS
  175.  
  176. Many of the PBClone routines return the date as a set of
  177. numbers.  This routine provides an easy way to convert those
  178. numbers into string form.  The date format used (year length
  179. and delimiter) will be based on the string which you pass to
  180. the routine.  For instance, "xx-xx-xxxx" will return a date
  181. like "11-26-1990", whereas "xx.xx.xxxx" would return
  182. "11.26.1990", and "xx/xx/xx" would return "11/26/90".
  183.  
  184. If you pass zeroes for the MonthNr%, Day%, and Year% values,
  185. the current date will be returned in the format that you
  186. specified.
  187.  
  188. The ProBas and PBClone versions of this routine do not work the
  189. same way in regards to the year.  ProBas assumed that any
  190. two-digit year was in the 1900s.  In contrast, PBClone assumes
  191. that years 80-99 should be converted to 1980-1999 and that 0-79
  192. should be converted to 2000-2079.
  193.  
  194.    DateSt$ = "xx-xx-xxxx"
  195.    DateN2S MonthNr%, Day%, Year%, DateSt$
  196.  
  197. MonthNr%  month
  198. Day%      day
  199. Year%     year
  200. -------
  201. DateSt$   date string.  Init to 8 or 10 chars (see above).
  202.  
  203.  
  204. Name  : DateR2A              (Date Relative to Actual)
  205. Class : Time
  206. Level : Any
  207.  
  208. This is the opposite of the DateA2R routine-- it takes a
  209. "relative" date and converts it back to the usual form.
  210.  
  211.    DateR2A MonthNr%, DayNr%, YearNr%, RelDate&
  212.  
  213. RelDate&     relative date
  214. -------
  215. MonthNr%     month number (1-12)
  216. DayNr%       day number (1-31)
  217. YearNr%      year number (1900 on)
  218.  
  219.  
  220. Name  : DateS2N              (Date String to Numbers)
  221. Class : Time
  222. Level : Any
  223.  
  224. Many of the PBClone routines need to be passed the date as a
  225. set of numbers. This routine provides an easy way to convert a
  226. date from string form into numbers.  You may use either
  227. "xx/xx/xx" or "xx-xx-xxxx" form to specify the date (the string
  228. length is important, but the delimiter and contents of the
  229. string are ignored).
  230.  
  231. The ProBas and PBClone versions of this routine do not work the
  232. same way in regards to the year.  ProBas assumed that any
  233. two-digit year was in the 1900s.  In contrast, PBClone assumes
  234. that years 80-99 should be converted to 1980-1999 and that 0-79
  235. should be converted to 2000-2079.
  236.  
  237.    DateS2N MonthNr%, Day%, Year%, DateSt$
  238.  
  239. DateSt$   date string.  Init to 8